<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE xsl:stylesheet  [
  <!ENTITY nbsp   "&#160;">
  <!ENTITY copy   "&#169;">
  <!ENTITY reg    "&#174;">
  <!ENTITY trade  "&#8482;">
  <!ENTITY mdash  "&#8212;">
  <!ENTITY ldquo  "&#8220;">
  <!ENTITY rdquo  "&#8221;"> 
  <!ENTITY pound  "&#163;">
  <!ENTITY yen    "&#165;">
  <!ENTITY euro   "&#8364;">
]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="html" encoding="utf-8" />
	<xsl:template name="webMeni">
		<xsl:value-of select="__caption" />
		<xsl:call-template name="webMeni">
			<xsl:with-param name="parent" select="'0'" />			
		</xsl:call-template>
	</xsl:template>
</xsl:stylesheet>

<xsl:template name="webMeni">
	<xsl:param name="parent"></xsl:param>
	<xsl:if test="count(/form/tables/webMeni/row[parent = $parent]) &gt; 0">
		<ul>
			<xsl:for-each select="/form/tables/webMeni/row[parent = $parent]">
				<xsl:sort select="ord_nr" data-type="number" />
				<xsl:variable name="parentID" select="id" />
				<xsl:if test="active = '1'">
					<li title="{description}">
						<xsl:if test="command = $sys_page or command = $__form">
							<xsl:attribute name="class">mnuSelected</xsl:attribute>
						</xsl:if>
						<xsl:choose>
							<xsl:when test="type=1">
								<a href="index.php?sys_page={command}">
									<xsl:value-of select="name" />
								</a>
							</xsl:when>
							<xsl:when test="type=2">
								<a href="index.php?__form={command}&amp;__noload=true">
									<xsl:value-of select="name" />
								</a>
							</xsl:when>
						</xsl:choose>
						<xsl:if test="command = $sys_page or command = $__form">
							<xsl:call-template name="webMeni">
								<xsl:with-param name="parent" select="id" />
							</xsl:call-template>
						</xsl:if>
						<xsl:if
							test="count(/form/tables/webMeni/row[parent = $parentID and (command = $sys_page or command = $__form)] ) &gt; 0">
							<xsl:call-template name="webMeni">
								<xsl:with-param name="parent" select="id" />
							</xsl:call-template>
						</xsl:if>
					</li>
				</xsl:if>
			</xsl:for-each>
		</ul>
	</xsl:if>
</xsl:template>


